package UnOfficeDeTourisme;

/**
 * Interface definition : Catalogue
 * 
 * @author OpenORB Compiler
 */
public class _CatalogueStub extends org.omg.CORBA.portable.ObjectImpl
        implements Catalogue
{
    static final String[] _ids_list =
    {
        "IDL:UnOfficeDeTourisme/Catalogue:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = UnOfficeDeTourisme.CatalogueOperations.class;

    /**
     * Read accessor for idCatalogue attribute
     * @return the attribute value
     */
    public int idCatalogue()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try {
                    org.omg.CORBA.portable.OutputStream _output = this._request("_get_idCatalogue",true);
                    _input = this._invoke(_output);
                    return _input.read_long();
                } catch (final org.omg.CORBA.portable.RemarshalException _exception) {
                    continue;
                } catch (final org.omg.CORBA.portable.ApplicationException _exception) {
                    final String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                } finally {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_get_idCatalogue",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.CatalogueOperations _self = (UnOfficeDeTourisme.CatalogueOperations) _so.servant;
                try
                {
                    return _self.idCatalogue();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Read accessor for nomCatalogue attribute
     * @return the attribute value
     */
    public String nomCatalogue()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try {
                    org.omg.CORBA.portable.OutputStream _output = this._request("_get_nomCatalogue",true);
                    _input = this._invoke(_output);
                    return _input.read_string();
                } catch (final org.omg.CORBA.portable.RemarshalException _exception) {
                    continue;
                } catch (final org.omg.CORBA.portable.ApplicationException _exception) {
                    final String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                } finally {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_get_nomCatalogue",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.CatalogueOperations _self = (UnOfficeDeTourisme.CatalogueOperations) _so.servant;
                try
                {
                    return _self.nomCatalogue();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Read accessor for listeDesPrestations attribute
     * @return the attribute value
     */
    public UnOfficeDeTourisme.Prestation[] listeDesPrestations()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try {
                    org.omg.CORBA.portable.OutputStream _output = this._request("_get_listeDesPrestations",true);
                    _input = this._invoke(_output);
                    return UnOfficeDeTourisme.listePrestationsHelper.read(_input);
                } catch (final org.omg.CORBA.portable.RemarshalException _exception) {
                    continue;
                } catch (final org.omg.CORBA.portable.ApplicationException _exception) {
                    final String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                } finally {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_get_listeDesPrestations",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.CatalogueOperations _self = (UnOfficeDeTourisme.CatalogueOperations) _so.servant;
                try
                {
                    return _self.listeDesPrestations();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation ajouterPresta
     */
    public void ajouterPresta(UnOfficeDeTourisme.Prestation p)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("ajouterPresta",true);
                    UnOfficeDeTourisme.PrestationHelper.write(_output,p);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("ajouterPresta",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.CatalogueOperations _self = (UnOfficeDeTourisme.CatalogueOperations) _so.servant;
                try
                {
                    _self.ajouterPresta( p);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation listerPresta
     */
    public UnOfficeDeTourisme.Prestation[] listerPresta()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("listerPresta",true);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Prestation[] _arg_ret = UnOfficeDeTourisme.listePrestationsHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("listerPresta",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.CatalogueOperations _self = (UnOfficeDeTourisme.CatalogueOperations) _so.servant;
                try
                {
                    return _self.listerPresta();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
